<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>执行客户开发计划</title>
 <link  href="${pageContext.request.contextPath}/css/client/style.css"  rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/admin-all.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
    <script src="${pageContext.request.contextPath}/js/layui/layui.all.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery/jquery-3.3.1.js"></script>

</head>
<body>
<div class="alert alert-info">客户开发计划<b class="tip"></b>执行开发计划</div>
<div class="button_bar">
    <input type="button" class="common_button" onclick="layer.alert('欢迎使用!');" value="帮助"/>
	<input type="button" class="common_button" onclick="window.history.go(-1);" value="返回"/>
</div>
<table class="query_table">
    <tr>
        <th>编号</th>
        <td>${saleChance.id}</td>
        <th>机会来源</th>
        <td>${saleChance.opportunity_source}</td>
    </tr>
    <tr>
        <th>客户名称</th>
        <td>${saleChance.customer_name}</td>
        <th>成功机率(%)</th>
        <td>${saleChance.success_probability}</td>
    </tr>
    <tr>
        <th>概要</th>
        <td colspan="3">${saleChance.summarize}</td>
    </tr>
    <tr>
        <th>联系人</th>
        <td>${saleChance.linkman}</td>
        <th>联系人电话</th>
        <td>${saleChance.link_tel}</td>
    </tr>
    <tr>
        <th>机会描述</th>
        <td colspan="3">${saleChance.opportunity_desc}</td>
    </tr>
    <tr>
        <th>创建人</th>
        <td>${saleChance.creator}</td>
        <th>创建时间</th>
        <td>${saleChance.create_time}</td>
    </tr>
</table>

</br>

<table class="data_table">
   <tr>
       <th>日期</th>
       <th>计划项</th>
       <th>执行效果</th>
   </tr>

    <c:forEach items="${planList}" var="plan" varStatus="status">
    <tr>
        <td>
            <span id="" name="plan_date">${plan.plan_date}</span>
        </td>
        <td>
            <span id="plan_desc" name="plan_desc">${plan.plan_desc}</span>
        </td>

        <td>
            <input name="executive_effect" type="text" value="${plan.executive_effect}"/>
            <input type="button" value="保存" id="obj" onclick="updPlan(this)"/>
            <input type="hidden" id="pid" name="pid"  value="${plan.id}"/>
        </td>
    </tr>
    </c:forEach>

    <script>
        function updPlan(obj) {
            //prev()返回上一个兄弟节点
            // 如果有多个元素有相同id $("#obj") 只能获取到第一个
            // var plan_desc =$("#obj").prev().val();
            var executive_effect = $(obj).prev().val();
           // layer.alert(executive_effect);
            //  next(),返回下一个兄弟节点，不是所有的兄弟节点
            var pid = $(obj).next().val();
            // var cus_id = $("#cus_id").val();
            //layer.alert(cus_id);
            // 框架会自动将参数 封装为对象属性
            window.location.href="updPlan?id="+pid+"&executive_effect="+executive_effect+"&type=doPlan";
        }
    </script>
</table>


</body>
</html>
